package bosanova

import grails.plugins.springsecurity.Secured
import org.codehaus.groovy.grails.plugins.springsecurity.SpringSecurityUtils

class HomeController {
  
  def springSecurityService
  
  def index = {
    session.getId()
    def view = 'index'
    if(SpringSecurityUtils.ifAllGranted('ROLE_ADMIN')){
      view = 'indexAd'
    } else if(SpringSecurityUtils.ifAllGranted('ROLE_ESTUDIANTE')){
      view = 'indexSt'
    } else if(SpringSecurityUtils.ifAllGranted('ROLE_PROFESOR')) {
      view = 'indexTe'
    } else if(SpringSecurityUtils.ifAllGranted('ROLE_SECRETARIA')) {
      view = 'indexSe'
    }
    render(view: view)
  }
}
